Rename Datatypes for Attributes

Hello,

I am new to DXL is there a way of changing the name of an existing datatype without changing its values(enum)?

Thank you,
Jim
SystemAdmin - Thu Sep 29 23:15:58 EDT 2011

Re: Rename Datatypes for Attributes
SystemAdmin - Fri Sep 30 07:34:36 EDT 2011

For a simple rename use "modify" function. If you want to modify something else it can get quite complicated as the discussions in this forum testify.
 

AttrType NewType = modify(OldType, "NewName")

 


From DXL Help

modify(attribute type)

AttrType modify(AttrType type,
string newName
[, string codes[ ],
int values[ ],
int colors[ ],
string descs[ ]
[, int arrMaps ],]
string &errmess)

The first form, without any optional parameters, changes the name of the specified attribute type to newName

 

Re: Rename Datatypes for Attributes
SystemAdmin - Fri Sep 30 12:44:31 EDT 2011

SystemAdmin - Fri Sep 30 07:34:36 EDT 2011

For a simple rename use "modify" function. If you want to modify something else it can get quite complicated as the discussions in this forum testify.
 

AttrType NewType = modify(OldType, "NewName")

 


From DXL Help

modify(attribute type)

AttrType modify(AttrType type,
string newName
[, string codes[ ],
int values[ ],
int colors[ ],
string descs[ ]
[, int arrMaps ],]
string &errmess)

The first form, without any optional parameters, changes the name of the specified attribute type to newName

 

Hello,

The following code I am trying to add a description and modify the datatype of existing attributes. I am able to get the description portion to work but not the renaming of the datatype. What am I doing wrong.

Thank you,
Jim



Module m = current
if (!null m)
{
m = edit(fullName m, true)
AttrDef ad = find(m, "Req Eval")
AttrType OldType = find(m, "Req Eval List")
if(ad != null)
{
modify (ad, setDescription, "Requirement Evaluation")
}
if(OldType != null)
{
modify (OldType, "Req Eval List2")
}
}

Re: Rename Datatypes for Attributes
SystemAdmin - Mon Oct 03 04:07:57 EDT 2011

SystemAdmin - Fri Sep 30 12:44:31 EDT 2011
Hello,

The following code I am trying to add a description and modify the datatype of existing attributes. I am able to get the description portion to work but not the renaming of the datatype. What am I doing wrong.

Thank you,
Jim



Module m = current
if (!null m)
{
m = edit(fullName m, true)
AttrDef ad = find(m, "Req Eval")
AttrType OldType = find(m, "Req Eval List")
if(ad != null)
{
modify (ad, setDescription, "Requirement Evaluation")
}
if(OldType != null)
{
modify (OldType, "Req Eval List2")
}
}

Sorry, my description of the modify function was wrong, it needs also a error message string:
 

string ErrMess = ""
modify (OldType, "Req Eval List2", ErrMess)